Skip to content

2046 - Mulitproduct AAQ CTA URL #6536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 12, 2025

Conversation

smithellis
Copy link
Contributor

Addresses mozilla/sumo#2046

The AAQ CTA in the sidebar would send the user to the new question page for the first product on documents where there were multiple products.

Now we set multiple_products in the aaq_context and if there are multiple products we will send the user to /questions/new so they can select a product.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses Issue 2046 by modifying the AAQ CTA behavior when multiple products are available. The changes update the AAQ context setup to include a new parameter that determines if multiple products exist, and update the related utility function accordingly.

  • Update in kitsune/wiki/views.py to pass a multiple_products flag based on the number of products.
  • Update in kitsune/sumo/utils.py to adjust the set_aaq_context signature and include the multiple_products information.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
kitsune/wiki/views.py Modified call to set_aaq_context to conditionally pass multiple_products
kitsune/sumo/utils.py Updated function signature and session context to include multiple_products
Comments suppressed due to low confidence (2)

kitsune/wiki/views.py:241

  • [nitpick] Consider simplifying the boolean expression for multiple_products by using 'len(products) > 1' directly for improved clarity.
set_aaq_context(request, product, multiple_products=True if len(products) > 1 else False)

kitsune/sumo/utils.py:399

  • [nitpick] Update the docstring to document the new 'multiple_products' parameter for clarity and consistency.
def set_aaq_context(request, product, multiple_products=False):

Copy link
Contributor

@escattone escattone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+wc

@@ -238,7 +238,7 @@ def maybe_vary_on_accept_language(response):
product = products.first()

# Set the AAQ context for the widget
set_aaq_context(request, product)
set_aaq_context(request, product, multiple_products=True if len(products) > 1 else False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can just be multiple_products=len(products) > 1.

@akatsoulas akatsoulas merged commit 2d75e42 into mozilla:main Mar 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants